package worldinruin.core;

import java.io.Serializable;

public interface IResources extends Serializable {

	/**
	 * Gets food amount.
	 * @return Food.
	 */
	int getFood();

	/**
	 * Gets iron amount.
	 * @return Iron.
	 */
	int getIron();

	/**
	 * Gets stone amount.
	 * @return Stone.
	 */
	int getStone();

	/**
	 * Gets wood amount.
	 * @return wood.
	 */
	int getWood();

	/**
	 * Adds resources to current resources.
	 * @param resources Amount of resources to add.
	 * @return New resource object with new amounts.
	 */
	IResources add(IResources resources);

	/**
	 * Multiplies resources.
	 * @param i Factor to multiply with.
	 * @return New resource amounts.
	 */
	IResources multiply(int i);

	/**
	 * Adds food amount to resources.
	 * @param food Amount of food.
	 * @return New resource object with added food.
	 */
	IResources addFood(int food);

	/**
	 * Adds iron amount to resources.
	 * @param iron Amount of iron.
	 * @return New resource object with added iron.
	 */
	IResources addIron(int iron);

	/**
	 * Adds stone amount to resources.
	 * @param stone Amount of stone.
	 * @return New resource object with added stone.
	 */
	IResources addStone(int stone);

	/**
	 * Adds wood amount to resources.
	 * @param wood Amount of wood.
	 * @return New resource object with added wood.
	 */
	IResources addWood(int wood);

	/**
	 * Checks if there are enough resources to afford a certain pruchase.
	 * @param r Prices of purchase.
	 * @return True if its affordable, false if not.
	 */
	boolean isAffordable(IResources r);

	/**
	 * Subtracts resources from current resources.
	 * @param r Amount of resources to subtract-
	 * @return New resource object with subtracted values.
	 */
	IResources subtract(IResources r);

	/**
	 * Checks if two resource objects has the same amount of resources.
	 * @param obj Second resource object.
	 * @return True if both have exact same amount of resources, false of not.
	 */
	boolean equals(Object obj);

}